from django.db import models


class Front(models.Model):
    username = models.CharField(max_length=30, null=False, db_column='user_name')
    age = models.IntegerField(null=False, db_column='user_age')
    create_time = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return '<Front(id=%s, username=%s, age=%s, create_time=%s>' % (self.id, self.username, self.age, self.create_time)

    class Meta:
        db_table = 'front_user'
        ordering = ['-create_time', '-age', 'id']